package com.block.product.enums;

import cn.hutool.core.util.ObjectUtil;
import lombok.Getter;

@Getter
public enum ProductTypeEnum {

    FREE(0, "免费"),
    VIP(1, "会员")
    ;

    Integer value;
    String label;

    ProductTypeEnum(Integer value, String label){
        this.value = value;
        this.label = label;
    }

    public static String getLabelByValue(Integer value){
        for (ProductTypeEnum typeEnum: values()){
            if (ObjectUtil.equal(typeEnum.getValue(), value)){
                return typeEnum.getLabel();
            }
        }
        return "";
    }
}
